wait_timeout = "3"
audio_cmd = [
    {
        "cmd": 'AT+SETVOLTE=0',
        "match": 'AT\+SETVOLTE=0\s{4}OK\s{2}',
    },
    {
        "cmd": 'AT+SETVOLTE?',
        "match": 'AT\+SETVOLTE\?\s{4}\+SETVOLTE: 0\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+SETVOLTE=1',
        "match": 'AT\+SETVOLTE=1\s{4}OK\s{2}',
    },
    {
        "cmd": 'AT+SETVOLTE?',
        "match": 'AT\+SETVOLTE\?\s{4}\+SETVOLTE: 1\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+SETVOLTE=?',
        "match": 'AT\+SETVOLTE=\?\s{4}\+SETVOLTE: 0,1\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CLCC',
        "match": 'AT\+CLCC\s{4}OK\s{2}',
    },
    {
        "cmd": 'AT+CLCC=?',
        "match": 'AT\+CLCC=\?\s{4}OK\s{2}',
    },
    {
        "cmd": 'AT+CLIP=?',
        "match": 'AT\+CLIP=\?\s{4}\+CLIP: \(0,1\)\s{4}OK\s{2}',
    },
    {
        "cmd": 'AT+CHLD=?',
        "match": 'AT\+CHLD=\?\s{4}\+CHLD: \(0,1,1X,2,2X,3\)\s{4}OK\s{2}',
    },
    {
        "cmd": 'AT+VTS=?',
        "match": 'AT\+VTS=\?\s{4}\+VTS: \(0\-9,\*,#,A,B,C,D\),\(1\-10\)\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+VTD=10',
        "match": 'AT\+VTD=10\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+VTD?',
        "match": 'AT\+VTD\?\s{4}\+VTD: 10\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+VTD=?',
        "match": 'AT\+VTD=\?\s{4}\+VTD: \(1\-10\)\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CTTSPARAM=50',
        "match": 'AT\+CTTSPARAM=50\s{4}OK\s{2}',
    },
    {
        "cmd": 'AT+CRSL=50',
        "match": 'AT\+CRSL=50\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CRSL?',
        "match": 'AT\+CRSL\?\s{4}\+CRSL: 50\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CTTS=1,"611F8C22"',
        "match": 'AT\+CTTS=1,"611F8C22"\s{4}OK\s{4}\+CTTS:0\s{2}',
        "wait": b'+CTTS:0',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CTTS=2,"999999"',
        "match": 'AT\+CTTS=2,"999999"\s{4}OK\s{4}\+CTTS:0\s{2}',
        "wait": b'+CTTS:0',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CTTSPARAM?',
        "match": 'AT\+CTTSPARAM\?\s{4}\+CTTSPARAM:50,0,50,50,0\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CTTSPARAM=100',
        "match": 'AT\+CTTSPARAM=100\s{4}OK\s{2}',
    },
    {
        "cmd": 'AT+CTTSPARAM?',
        "match": 'AT\+CTTSPARAM\?\s{4}\+CTTSPARAM:100,0,50,50,0\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+AUDCH=2',
        "match": 'AT\+AUDCH=2\s{4}OK\s{2}',
    },
    {
        "cmd": 'AT+AUDCH=?',
        "match": 'AT\+AUDCH=\?\s{4}\+AUDCH: \(0\-2\),\(0,1,3,4\)\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CRSL=100',
        "match": 'AT\+CRSL=100\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CRSL?',
        "match": 'AT\+CRSL\?\s{4}\+CRSL: 100\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CTTS=1,"611F8C22"',
        "match": 'AT\+CTTS=1,"611F8C22"\s{4}OK\s{4}\+CTTS:0\s{2}',
        "wait": b'+CTTS:0',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CTTS=2,"999999"',
        "match": 'AT\+CTTS=2,"999999"\s{4}OK\s{4}\+CTTS:0\s{2}',
        "wait": b'+CTTS:0',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CLVL=100',
        "match": 'AT\+CLVL=100\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CLVL?',
        "match": 'AT\+CLVL\?\s{4}\+CLVL: 100\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CLVL=?',
        "match": 'AT\+CLVL=\?\s{4}\+CLVL: \(0\-100\)\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+SPKPA=1',
        "match": 'AT\+SPKPA=1\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+SPKPA?',
        "match": 'AT\+SPKPA\?\s{4}\+SPKPA: \d\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CAUDREC?',
        "match": 'AT\+CAUDREC\?\s{4}\+CAUDREC: 0\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CAUDREC=?',
        "match": 'AT\+CAUDREC=\?\s{4}\+CAUDREC: \(1-\d\),\<filename\>,\(1,2\),\(0-3\),\<time\>\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CAUDPLAY?',
        "match": 'AT\+CAUDPLAY\?\s{4}\+CAUDPLAY: 0\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CAUDPLAY=?',
        "match": 'AT\+CAUDPLAY=\?\s{4}\+CAUDPLAY: \(1-4\),\<filename\>,\(1-2\)\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CAUDREC=1,"A.WAV",1,2,50',
        "match": 'AT\+CAUDREC=1,"A.WAV",1,2,50\s{4}OK\s{4}\+CAUDREC: 1,5000\s{2}',
        "wait": b'+CAUDREC: 1,5000',
        "timeout": 10
    },
    {
        "cmd": 'AT+CAUDPLAY=1,"A.WAV"',
        "match": 'AT\+CAUDPLAY=1,"A.WAV"\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CAUDPLAY=3',
        "match": 'AT\+CAUDPLAY=3\s{4}OK\s{4}\+CAUDPLAY: 3,\d+\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CAUDPLAY=4',
        "match": 'AT\+CAUDPLAY=4\s{4}OK\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
    {
        "cmd": 'AT+CAUDPLAY=2',
        "match": 'AT\+CAUDPLAY=2\s{4}OK\s{4}\+CAUDPLAY: 2,0\s{2}',
        "wait": b'OK',
        "timeout": wait_timeout
    },
]
